package cn.wit.luohui.day04;

public class ContinuousFour {
	public static void main(String[] args) {
		int[] numbers1={8,9,9,9,9,8};
		int[] numbers2={8,9,9,9,8};
		System.out.println(hasContinuousFour(numbers1));
		System.out.println(hasContinuousFour(numbers2));
	}
		public static boolean hasContinuousFour(int[] numbers) {
			for(int i = 0;i<numbers.length-4;i++) {
				if(numbers[i]==numbers[i+1])
					if(numbers[i+1]==numbers[i+2])
					if(numbers[i+2]==numbers[i+3]){
					return true;
				}
				}
				return false;
			}

		}
	
